﻿using System.Collections.Generic;
using System.Windows.Forms;
using DevTools.BinDeleter.Components;
using DevTools.BinDeleter.Controls;
using DevTools.Properties;

namespace DevTools.BinDeleter.Forms
{
    public partial class BinDeleterForm : Form
    {
        public BinDeleterForm()
        {
            InitializeComponent();

        }

        private void uscPathSelector_Browsed(object sender, PathSelector.BrowsedEventArgs e)
        {
            ICollection<FolderInfo> folders = Deleter.Instance.GetBinFolders(e.Path);

            if (MessageBox.Show(Resources.SureToDelete, "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
                Deleter.Instance.Delete(folders);
        }
    }
}